<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0;user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>车牌生成</title>
  <link rel="stylesheet" href="./weui.min.css">
</head>

<body>
  <div class="weui-cells__title">结果</div>
  <div id="result" class="weui-cells weui-cells__after-title">
    <div class="weui-cell weui-cell_access">
      <p class="weui-cell__bd">暂无结果</p>
    </div>
  </div>
  <!-- <div class="weui-cell weui-cell__input">
    <div class="weui-cell__bd">
      <input class="weui-input" id="numInput" type="number" placeholder="生成数量">
    </div>
  </div> -->
  <div class="weui-btn-area">
    <button id="genBtn" class="weui-btn weui-btn_primary">换一批</button>
  </div>
  <script src="./randexp.min.js"></script>
  <script src="./zepto.min.js"></script>
  <script>
    var num = 10;
    $('#numInput').val(num);
    $('#numInput').on('input', function numInputHandler(e) {
      num = Number.parseInt(e.target.value) || 0;
    });
    $('#genBtn').on('click', function () {
      var carNums = [];
      for (var i = 0; i < num; i++) {
        var carNum = new RandExp(/苏U(A0[012356789]{3}|AA[012356789]{3}|00[012356789]{3}|10[012356789]{3})/).gen();
        var result = '<div class="weui-cell weui-cell_access"><p class="weui-cell__bd">' + carNum + '</p></div>';
        carNums.push(result);
      }
      $('#result').html(carNums.join(''));
    });
    $('#genBtn').click();
  </script>
</body>

</html>